home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / c / flash-0.4.3.lha / flash-0.4.3 / Lib / adpcm.h < prev    next >
C/C++ Source or Header  |  1999-02-21  |  776b  |  41 lines

  1. #ifndef _ADPCM_H_
  2. #define _ADPCM_H_
  3.  
  4. #ifdef DUMP
  5. #include "bistream.h"
  6. #endif
  7.  
  8. class Adpcm {
  9.  
  10.     // Destination format - note we always decompress to 16 bit
  11.     long         stereo;
  12.     int         nBits;  // number of bits in each sample
  13.  
  14.     long         valpred[2]; // Current state
  15.     int         index[2];
  16.  
  17.     long          nSamples; // number of samples decompressed so far
  18.  
  19.     // Parsing Info
  20.     unsigned char     *src;
  21.     long         bitBuf; // this should always contain at least 24 bits of data
  22.     int         bitPos;
  23.  
  24.     void FillBuffer();
  25.  
  26.     long GetBits(int n);
  27.  
  28.     long GetSBits(int n);
  29.  
  30. public:
  31.     Adpcm(unsigned char *buffer, long isStereo);
  32.  
  33.     void Decompress(short * dst, long n); // return number of good samples
  34. #ifdef DUMP
  35.     void dump(BitStream *bs);
  36.     void Compress(short *pcm, long n, int bits);
  37. #endif
  38. };
  39.  
  40. #endif /* _ADPCM_H_ */
  41.